import request from '@/utils/request'

// 获取所有部门
export function getDepartments() {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}

// 删除组织架构部门
export function delDepartments(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}

// 添加组织部门
export function addDepartments(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}

// 根据id获取部门
export function getDepartmentDetail(id) {
  return request({
    method: 'GET',
    url: `/company/department/${id}`
  })
}

// 修改部门信息
export function updateDepartments(data) {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}
